Sql statement return with zero result [closed]
Posted
by
foodil
on Programmers
See other posts from Programmers
or by foodil
Published on 2012-03-20T06:28:24Z
Indexed on
2012/03/20
11:37 UTC
Read the original article
Hit count: 180
I am trying to choose the row where
1)list.ispublic = 1
2)userlist.userid='aaa'
AND userlist.listid=list.listid
I need 1)+2)
There is a row already but this statement can not get that row, is there any problem?
List table:
ListID ListName Creator IsRemindSub IsRemindUnSub IsPublic CreateDate LastModified Reminder
1 test2 aaa 0 0 1 2012-03-09 NULL NULL
user_list table (No row):
UserID ListID UserRights
My test version
SELECT l.*, ul.*
FROM list l
INNER JOIN user_list ul ON ul.ListID = l.ListID
WHERE l.IsPublic = 1
AND ul.UserID = 'aaa'
There is zero result. How can I fix that?
© Programmers or respective owner